<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>会员登录</title>
<link href="<%=basePath%>skin/css/public.css" rel="stylesheet" type="text/css" />
<link href="<%=basePath%>skin/css/validform/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<%=basePath%>skin/js/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="<%=basePath%>skin/js/validform/Validform_v5.3.2_min.js"></script>
<script language="javascript">
	 $().ready(function(){
		 $("#validateCodeImg").click(function(){
			 $(this).attr("src","<%=basePath%>/validateCode.shtml?data=" + new Date() + Math.floor(Math.random()*24));
		 });
		 $("#change-code").click(function(){
			 $("#validateCodeImg").attr("src","<%=basePath%>/validateCode.shtml?data=" + new Date() + Math.floor(Math.random()*24));
		 });
		 
		//验证
		 var validform = $("#form1").Validform({
			btnSubmit:"#save",
			tiptype:3
		 });
		 validform.addRule([
			{
			    ele:"#username",
			    datatype:"*",
			    nullmsg:"请输入用户名！"
			},
			{
			    ele:"#password",
			    datatype:"*",
			    nullmsg:"请输入密码！"
			},
			{
			    ele:"#validateCode",
			    datatype:"n",
			    nullmsg:"请输入验证码！"
			}
		 ]);
		 
		 $("#register").click(function(){
			var redirectUrl = encodeURI("${redirectUrl }");
			window.location.href="<%=basePath%>register.shtml?redirectUrl="+redirectUrl;
		 });
	 });
</script>
</head>

<body>
	<div class="login">
    	<div class="container">
        	<div class="content">
                <div class="login-content">
                    <div class="stepbar">
                        <h1 class="buy-logo">用户登陆</h1>
                        <a href="<%=basePath%>"><img src="<%=basePath%>skin/images/logo.png" /></a>
                    </div>
                    <div class="login-main">
                        <div class="login-box">
                            <div class="hd">
                                <ul>
                                    <li>
                                        <h2>登陆</h2>
                                    </li>
                                </ul>
                            </div>
                            <div class="bd">
<form id="form1" name="form1" method="post" action="<%=basePath%>login/sumbit.shtml">
<input type="hidden" id="redirectUrl" name="redirectUrl" value="${redirectUrl }"/>
                                <div class="input-box">
                                    <div class="static">
                                        <div class="field">
                                            <label></label>
                                            <input class="login-text" id="username" name="username" type="text" value="输入用户名" autocomplete="off"  onFocus="if(value=='输入用户名'){value='';this.style.color='#000'}" onBlur="if(!value){value=defaultValue;this.style.color='#999999'}" style="color:#999999" />
                                        </div>
                                        <div class="field pwd-field">
                                            <label></label>
                                            <span>
												<input class="login-text" id="password" name="password" type="password" value="输入密码" autocomplete="off" onFocus="if(value=='输入密码'){value='';this.style.color='#000';this.type='password'}" onBlur="if(!value){value='输入密码';this.style.color='#999999';this.type='text'}" style="color:#999999" />      	
                                            </span>
                                        </div>
                                        <div id="l_f_code" class="field field-checkcode hidden">
                                            <input type="text" name="validateCode" id="validateCode" class="login-text checkcode J_CheckCode"/>
                                            <img id="validateCodeImg" src="<%=basePath%>validateCode.shtml" title="点击图片刷新验证码"/>
                                            <a class="change-code" href="javascript:void(0)" id="change-code">
                                           	 看不清<br>换一张
                                            </a>
                                        </div>
                                        <div class="safe">
                                            <!-- <a class="forget-pw" target="_blank" href="javascript:void(0)">忘记登录密码?</a> -->
                                        </div>
                                        <div class="submit">
                                            <a class="login-submit" id="save">登　陆</a>
                                        </div>
                                        <ul class="entries">
                                            <li class="other-login">
                                            </li>
                                            <li class="register">
                                                <a target="_blank" id="register">免费注册</a>
                                            </li>
                                        </ul>
                                    </div>
                                </div>
</form>                                
                            </div>
                        </div>
                        <div class="login-bg">
                            <img src="<%=basePath%>skin/images/pop-pro1.jpg" />
                        </div>
                    </div>
                </div>
			</div>
<c:import url="/layouts/foot2.jsp" />
        </div>
    </div>
</body>
</html>
